
import com.vfd.controls.navigation.IPreviousNext;

/**
 * This class assumes that you are attaching in via the linkage in the library and has moviclips or
 * buttons with instance names that match the instance varaibles for this class. You can then attach
 * actions to the previous and next buttons using the setter methods.
 * @author Jeremy Wischusen <cortex@visualfowdesigns.com>
 */
class com.vfd.controls.navigation.PreviousNext
{
	private var nextButton:MovieClip;
	private var prevButton:MovieClip;
	private var actionHandler:IPreviousNext;
	public function PreviousNext(actionHandler:IPreviousNext)
	{
		this.nextButton.actionHandler = actionHandler;
		this.prevButton.actionHandler = actionHandler;
		this.nextButton.onRelease = this.next;
		this.prevButton.onRelease = this.prev;
	}
	
	public function next()
	{
		this.actionHandler.onNext();
	}
	
	public function prev()
	{
		this.actionHandler.onPrev();
	}
	
	public function set handler(handler:IPreviousNext)
	{
		this.nextButton.actionHandler = handler;
		this.prevButton.actionHandler = handler;
	}
	
}
